package com.jcgyl.export.runner;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import com.jcgyl.export.util.DictionaryHelper;
import com.jcgyl.export.util.MyDao;

@Component
@Order(3)
public class DbRunner implements CommandLineRunner {

	@Value("${spring.datasource.url}")
	private String server;
	@Value("${spring.datasource.username}")
	private String user;
	@Value("${spring.datasource.password}")
	private String password;

	@Override
	public void run(String... args) throws Exception {
		System.out.println(">>>>>>>>>>>>>>>字典数据开始加载...<<<<<<<<<<<<<");
		DictionaryHelper.Init();
		MyDao.server = server;
		MyDao.user = user;
		MyDao.password = password;

		System.out.println(">>>>>>>>>>>>>>>字典数据加载完成...<<<<<<<<<<<<<");
	}
}
